package mao.sourcecode.threadlocal;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ThreadLocalTest {
    private static ThreadLocal<Integer> localInt = new MyThreadLocal();

    public static void main(String[] args) {
        ExecutorService execu  = Executors.newCachedThreadPool();
        //Future<?>[] futures = new Future[10];
        for (int i = 0; i < 100; i++) {
            execu.submit(new Consumer(localInt));
        }
        execu.shutdown();
        //Executors.newSingleThreadExecutor();
    }
}
